﻿/*!	@file	r_config.h
	@brief	ライブラリ用コンパイル設定関係
Copyright (c) 2009 Yuya Yamaguchi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#ifndef _R_CONFIG_H_
#define _R_CONFIG_H_

// ------------------------------------------

// デバッグ機能付コンパイル
#define RDEBUG_BUILD

// プロファイル有効
#define	RDEBUG_PROFILE_ENABLE

#define	RDEBUG_PROFILE_BUILD		(defined RDEBUG_BUILD) && (defined RDEBUG_PROFILE_ENABLE)

// ------------------------------------------

// ターゲット定義
#define	R_TARGET_COMMON_SHIFT(code)			((code) << 16)

#define R_TARGET_DATA(common, unique)		((common) | (unique))

#define R_TARGET_UNIQUE_MASK(target)		((target) & 0xffff)

#define R_TARGET_COMMON_MASK(target)		((target) & 0xffff0000)

#define	R_TARGET_COMMON_WIN32				R_TARGET_COMMON_SHIFT ( 0 )		//!< 32bitWindows
#define	R_TARGET_COMMON_WIN64				R_TARGET_COMMON_SHIFT ( 1 )		//!< 64bitWindows

// OpenGLはとりあえず形だけ...
#define	R_TARGET_UNIQUE_WINGL				0								//!< WindowsOpenGL
#define	R_TARGET_UNIQUE_WINDX11				1								//!< WindowsOpenDirectX11


// ターゲット
#define R_WIN32GL			R_TARGET_DATA(R_TARGET_COMMON_WIN32, R_TARGET_UNIQUE_WINGL)
#define R_WIN32DX11			R_TARGET_DATA(R_TARGET_COMMON_WIN32, R_TARGET_UNIQUE_WINDX11)
#define R_WIN64GL			R_TARGET_DATA(R_TARGET_COMMON_WIN64, R_TARGET_UNIQUE_WINGL)
#define R_WIN64DX11			R_TARGET_DATA(R_TARGET_COMMON_WIN64, R_TARGET_UNIQUE_WINDX11)

// ##########################################
// コンパイルスイッチ 有効にできるコンパイルモードはひとつだけ
// ##########################################
//#define	R_TARGET		R_WIN32GL
#define	R_TARGET			R_WIN32DX11
//#define	R_TARGET		R_WIN64GL
//#define	R_TARGET		R_WIN64DX11


#define R_TARGET_COMMONIS(common)			( R_TARGET_COMMON_MASK( R_TARGET ) == (common) )
#define R_TARGET_UNIQUEIS(unique)			( R_TARGET_UNIQUE_MASK( R_TARGET ) == (unique) )
// Windowsシリーズ
#define	R_TARGET_COMMON_WINDOWS				(R_TARGET_COMMONIS(R_TARGET_COMMON_WIN32) || R_TARGET_COMMONIS(R_TARGET_COMMON_WIN64))
// DirectXシリーズ
#define R_TARGET_UNIQUE_DIRECTX				R_TARGET_UNIQUEIS(R_TARGET_UNIQUE_WINDX11)
// OpenGLシリーズ
#define R_TARGET_UNIQUE_OPENGL				R_TARGET_UNIQUEIS(R_TARGET_UNIQUE_WINGL)


// ------------------------------------------

// 文字コード
// R_USE_WCHARが定義されることでワイド文字を使用する
#define R_USE_WCHAR

// ------------------------------------------

// 入力ストリーム定義
#define	R_STREAM_TYPE_FILE		(0)			//!< ファイル入力
#define	R_STREAM_TYPE_PACKFILE	(1)			//!< 連結ファイル入力
#define	R_STREAM_TYPE_HIO		(2)			//!< HostIO入力


// ##########################################
// コンパイルスイッチ 有効にできるコンパイルモードはひとつだけ
// ##########################################
#define	R_STREAM_TYPE			R_STREAM_TYPE_FILE
//#define	R_STREAM_TYPE		R_STREAM_TYPE_PACKFILE
//#define	R_STREAM_TYPE		R_STREAM_TYPE_HIO

#define	R_STREAM_TYPEIS(type)	(R_STREAM_TYPE == type)

// ------------------------------------------

// 描画処理の詳細チェック
//#define	R_DRAW_MOREDEBUG

// ------------------------------------------

// 組み込むスクリプトの定義
#define R_SCRIPT_USE_XTAL					//!< xtal
// ...将来的にはsquirrel(sqplus)も検討しても良いかも
// ...あとはluaか...

// ------------------------------------------

#endif // _R_CONFIG_H_
